package com.pic.mgt.scheduler;

import org.quartz.SchedulerException;
import org.quartz.SchedulerListener;
import org.quartz.Trigger;

import com.pic.mgt.log.IgxLog;
import com.pic.mgt.utils.IgxUtils;
import com.pic.mgt.utils.LogUtils;

/**
 * Quartz StdScheduler 的動作通知,包含 StdScheduler自生發生 Exception 時也可以進行通知.
 * @author p10118178
 *
 */
public class QuartzAutoJobSchedulerListener implements SchedulerListener {

	@Override
	public void jobScheduled(Trigger arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void jobUnscheduled(String arg0, String arg1) {
		// TODO Auto-generated method stub

	}

	@Override
	public void jobsPaused(String arg0, String arg1) {
		// TODO Auto-generated method stub

	}

	@Override
	public void jobsResumed(String arg0, String arg1) {
		// TODO Auto-generated method stub

	}

	@Override
	public void schedulerError(String message, SchedulerException arg1) {
		// ********************** Log **********************
		LogUtils.error(this, IgxLog.messageDetailsLog, arg1);
		// ********************** Log **********************
		
		// ********************** Log **********************
		IgxLog.messageLog.error(this, "SUDA-399 (Quartz Scheduler Error: {})", message);
		// ********************** Log **********************
	}

	@Override
	public void schedulerShutdown() {
		// TODO Auto-generated method stub

	}

	@Override
	public void triggerFinalized(Trigger arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void triggersPaused(String arg0, String arg1) {
		// TODO Auto-generated method stub

	}

	@Override
	public void triggersResumed(String arg0, String arg1) {
		// TODO Auto-generated method stub

	}

}
